* Replication code for Aarøe, Petersen and Arceneaux (2017) Danish Laboratory Sample 3 *

* This do file reproduces analyses related to the Danish Laboratory Sample 3
* Use the following replication data set: "Replication Data Set Danish Sample 3"
** See the Online Appendix for details on question wording 

set more off

******************************************************************************************************
* recodings and reliability code reported here
******************************************************************************************************

******************************************************************************************************
*recodings and reliability codes for Test 1
******************************************************************************************************

*physiological SCR measure ranging form 0 to 1 (OBS the mimimum value is minimally larger than 0 but this has no practical implication
gen disgustphys=Area5+Area6+Area10+Area15+Area25+Area13
gen disgustphys01=(disgustphy/9.733975)

* mean and standard deviation of the physiological disgust measure (reported in Online Appendix A4.1.3)
sum disgustphys01

*Creating scales for contamination disgust, core disgust and animal reminder disgust
* recoding of items for the contamination disgust, core disgust and animal reminder disgust scales
gen monkey01 = 4 - s1s3a
gen roach06 = 4 - s1s3f
gen eye10 = 4 - s1s3j

recode s1s3b (0=0) (1=1) (2=2) (3=3) (4=4), gen (hand02)
recode s1s3c (0=0) (1=1) (2=2) (3=3) (4=4), gen (throat03)
recode s1s3d (0=0) (1=1) (2=2) (3=3) (4=4), gen (toilet04)
recode s1s3e (0=0) (1=1) (2=2) (3=3) (4=4), gen (grave05)
recode s1s3g (0=0) (1=1) (2=2) (3=3) (4=4), gen (body07)
recode s1s3h (0=0) (1=1) (2=2) (3=3) (4=4), gen (vomit08)
recode s1s3i (0=0) (1=1) (2=2) (3=3) (4=4), gen (cook09)
recode s1s3k (0=0) (1=1) (2=2) (3=3) (4=4), gen (rat11)

recode s1s3m (0=0) (1=1) (2=2) (3=3) (4=4), gen (soup13) 
recode s1s3n (0=0) (1=1) (2=2) (3=3) (4=4), gen (hotel14)
recode s1s4a (0=0) (1=1) (2=2) (3=3) (4=4), gen (maggots15)

recode s1s4d (0=0) (1=1) (2=2) (3=3) (4=4), gen (urine17)
recode s1s4e (0=0) (1=1) (2=2) (3=3) (4=4), gen (soda18)
recode s1s4f (0=0) (1=1) (2=2) (3=3) (4=4), gen (cat19)
recode s1s4b (0=0) (1=1) (2=2) (3=3) (4=4), gen (icecrm20)
recode s1s4g (0=0) (1=1) (2=2) (3=3) (4=4), gen (intest21)
recode s1s4h (0=0) (1=1) (2=2) (3=3) (4=4), gen (underw22)
recode s1s4i (0=0) (1=1) (2=2) (3=3) (4=4), gen (chocl23)
recode s1s4j (0=0) (1=1) (2=2) (3=3) (4=4), gen (ashes24)
recode s1s4k (0=0) (1=1) (2=2) (3=3) (4=4), gen (milk25)
recode s1s4l (0=0) (1=1) (2=2) (3=3) (4=4), gen (condom26)
recode s1s4m (0=0) (1=1) (2=2) (3=3) (4=4), gen (worm27)

*three subscale means (for core disgust, animal-reminder disgust, and contamination-disgust), and the whole scale 

* creation of the core disgust scale 
egen core_av=rmean(monkey01 throat03 roach06 vomit08 rat11 soup13 maggots15 urine17 icecrm20 underw22 milk25 worm27)

* creation of the animal reminder disgust scale
egen anrem_av = rmean(hand02 grave05 body07 eye10 hotel14 cat19 intest21 ashes24)

* creation of the contamination disgust scale
egen contam_av = rmean (toilet04 cook09 soda18 chocl23 condom26)

* creation of the full DS-R scale
egen dsr_av = rmean (monkey01 hand02 throat03 toilet04 grave05 roach06 body07 vomit08 cook09 eye10 rat11 soup13 hotel14 maggots15 urine17 soda18 cat19 icecrm20 intest21 underw22 chocl23 ashes24 milk25 condom26 worm27)

*recoding the core disgust, animal reminder disgust, contamination disgust and the DS-R scales to range from 0 to 1
gen dsr_av01 =dsr_av/4
gen core_av01 =core_av/4
gen anrem_av01 =anrem_av/4
gen contam_av01 =contam_av/4

*Crohnbachs' alpha reliability coefficient for the core disgust scale (reported in Online Appendix A5.1)
alpha monkey01 throat03 roach06 vomit08 rat11 soup13 maggots15 urine17 icecrm20 underw22 milk25 worm27

* Crohnbachs' alpha reliability coefficient for the animal reminder disgust scale (reported in Online Appendix A5.1)
alpha hand02 grave05 body07 eye10 hotel14 cat19 intest21 ashes24

* Crohnbachs' alpha reliability coefficient for the contamination disgust scale (reported in footnote 5 in the main text and in Online Appendix A4.1.2)
alpha toilet04 cook09 soda18 chocl23 condom26

* mean and standard deviation of the contamination disgust scale (reported in Online Appendix A4.1.2)
sum contam_av01

*creation of the scale measuring opposition to immigration (ranging from 0 to 1)
gen s1s11arc = s1s11a
recode s1s11arc (0=6) (1=5) (2=4) (3=3) (4=2) (5=1) (6=0)
gen s1s11erc = s1s11e
recode s1s11erc (0=6) (1=5) (2=4) (3=3) (4=2) (5=1) (6=0)

egen antiimmig=rmean (s1s11b s1s11c s1s11d s1s11f s1s11arc s1s11erc)
gen antiimmig01=antiimmig/6

*Crohnbachs' alpha reliability coefficient for the scale measuring opposition to immigration (reported in the main text in "Materials and methods" in Test 1 and in Online Appendix A4.2)
alpha s1s11b s1s11c s1s11d s1s11f s1s11arc s1s11erc

* mean and standard deviation of the scale measuring opposition to immigration (reported in Online Appendix A4.2)  
sum antiimmig01

* ideology (7-point measure) ranging from 0 to 1, higher values more right-wing (conservative)
gen ideo01= (s1s1-1)/6

* mean and standard deviation of the measure of political ideology (reported in Online Appendix A4.2)
sum ideo01

* ideology coded in three categories (for Table A9 in Online Appendix A5.4)
ta s1s1
gen ideo3=s1s1
recode ideo3 (1=1) (2=1) (3=1) (4=2) (5=3) (6=3) (7=3)
label define ideo3 1 "Left-wing (liberals)" 2 "Middle of the road" 3 "right-wing (Conservatives)"
label values ideo3 ideo3

* gender (1 = female)
gen female=Køn

* age
gen age=Alder

******************************************************************************************************
* Sample characteristics (reported in the Online Appendix A3.1)
******************************************************************************************************

ta female
sum age
sum ideo01


******************************************************************************************************
* Analyses
******************************************************************************************************

***********************************************************
*Results for Test 1
***********************************************************

* Results reported in the main text

* Test 1, Table 2, Model 3 - the effect of behavioral immune sensitivity on opposition to immigration
eststo: reg antiimmig01 disgustphys01 female age ideo01
esttab, b(%5.2f) se(%5.2f), using part_2.rtf, replace onecell star(* 0.10 ** 0.02 *** 0.002) wide constant ar2
eststo clear

* Test 1, footnote 5 - intercorrelations between the items in the five item contamination disgust scale
cor toilet04 cook09 soda18 chocl23 condom26

* Test 1, footnote 5 in the main text and Online Appendix A5.3 in text - correlation between the physiological and the self-reported disgust measure
pwcorr disgustphys01 contam_av01, sig obs

* Test 1, footnote 6, main text, and Online Appendix A5.4, Table A8, Model 1 - interactions between behavioral immune sensitivity and ideology
eststo: reg antiimmig01 c.disgustphys01##c.ideo01 female age, robust 
esttab, b(%5.2f) se(%5.2f), using part_2.rtf, replace onecell star(* 0.10 ** 0.02 *** 0.002) wide constant ar2
eststo clear

* Test 1 - Online Appendix A4.1.4, Table A3, DK Sample 3 - bivariate correlations between measures of behavioral immune sensitivity and demographics (two-sided tests)
pwcorr disgustphys01 female  age, sig obs
pwcorr contam_av01 female  age, sig obs

* Test 1 - Online Appendix A5.1, Table A5, Models 5-6, - correlation between contamination disgust and antiimmigration attitudes controling for other types of disgust
reg antiimmig01 disgustphys01 dsr_av01, beta
reg antiimmig01 disgustphys01 core_av01 anrem_av01, beta 

* Test 1 - Online Appendix A5.4, Table A7, Model 3 - zero-order correlation with ideology
pwcorr disgustphys01 ideo01, sig obs

* Test 1 - Online Appendix A5.4, Table A9, third row - mean and standard deviation in behavioral immune sensitivity by ideology (3 categories)
bys ideo3: sum disgustphys01

* Test 1 - Supplemental analysis reported in text in Online Appendix A5.4 - respondents identifying as right-wing (conservatives) report significantly higher behavioral immune sensitivity than respondents identifying as left-wing (liberals)
reg disgustphys01 i.ideo3

* Test 1, Online Appendix A5.2 (results summarized in text) Supplemental analysis of robustness of the effect of contamination disgust excluding 
eststo: reg antiimmig01 disgustphys01 female age ideo01
esttab, b(%5.2f) se(%5.2f), using part_2.rtf, replace onecell star(* 0.10 ** 0.02 *** 0.002) wide constant ar2
eststo clear

* Test 1, Online Appendix A5.3, Table A6 - Supplemental analyses of the effect of physiological scr disgust sensitivity measure
eststo: reg antiimmig01 disgustphys01 female age 
eststo: reg antiimmig01 disgustphys01 contam_av01 female age ideo01
esttab, b(%5.2f) se(%5.2f), using part_2.rtf, replace onecell star(* 0.10 ** 0.02 *** 0.002) wide constant ar2
eststo clear

* Test 1, Online Appendix A5.4, footnote 7 - zero-order correlation between the contamination disgust measure and ideology
pwcorr contam_av01 ideo01, sig obs

* Test 1, Online Appendix A5.4, footnote 8 - no respondents identify as "extremely right-wing" (=value 1) on the 7-point ideology measure in Sample 3
ta ideo01 
